<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<meta http-equiv="keywords" content="" />
		<meta http-equiv="description" content="" />
		<title>工房受注管理</title>

		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		<script src="assets/scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>

		<script src="assets/scripts/ui/jquery-ui-1.7.2.custom.js" type="text/javascript"></script>
		<link type="text/css" href="./assets/styles/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>
		<script type="text/javascript">
		$(function() {
		
			// メッセージのフェード
			$('.message').fadeIn("slow");

		});
		</script>
	
		<link rel="stylesheet" type="text/css" href="./assets/styles/tablesorter.css" />

		<script type="text/javascript" src="./assets/scripts/tablesorter.js"></script>
		<script type="text/javascript">
			var sorter = new TINY.table.sorter("sorter");
				sorter.head = "head";
				sorter.asc = "asc";
				sorter.desc = "desc";
				sorter.even = "evenrow";
				sorter.odd = "oddrow";
				sorter.evensel = "evenselected";
				sorter.oddsel = "oddselected";
				sorter.paginate = true;
				sorter.currentid = "currentpage";
				sorter.limitid = "pagelimit";
			$(function(){
					sorter.init("inquiry_result",0);
			});
		</script>
		
		
	</head>
	<body id="" >
{{ php }} include( MENU_FILE ); {{ /php }}  

		<div id="header" class="clearfix"><div class="wrapper">
			<h1><a href="./">コントロールパネル</a></h1>
			<form id="form_logout" action="logout.php" method="post"><p>{{ $login.staff_name }} <input type="submit" id="button_logout" value="ログアウト" /></p></form>
		</div></div>
		<div id="container"><div class="wrapper">

			<h2>工房受注管理</h2>
			<ul class="submenu clearfix">
				<li><a href="order_search.php">受注検索</a></li>								
				<li><a href="order.php">受注登録</a></li>
				<li>商品マスタ</li>
			</ul>
			
			<h3>商品検索</h3>
			<h4>タスク一覧</h4>
			
			<ul>					
				<li>＞ <a href="order_shop_form.php">商品登録</a></li>
			</ul>
			
			<p class="message">条件を入力し、検索ボタンをクリックしてください。</p>
			
			<form action="order_shop.php" method="get">
			<table id="inquiry_result" class="formTable">
				<thead>
					<tr>
						<th>商品名</th>
						<td><input type="text" name="shop_name" id="text_information" class="text" value="{{$forms.shop_name}}" /></td>
					</tr>
					<tr>
						<th>サイズ</th>
						<td>
						<select name="size" class="text" >
							{{ foreach from=$size_list key=k item=v }}
							<option value="{{$k}}" {{if $forms.size == $k }} selected {{/if}} >{{$v}}</option>
							{{ /foreach }}
						</select>
						</td>
					</tr>					
				</thead>			
			</table>	
			<p class="button">
				<button type="submit" id="btn_search" class="submit"><span>検索</span></button>
			</p>
			</form><br/><br/>

			<p class="message">検索へ<span style="color: red">{{$cnt}}</span>レコード</p>

{{ if $cnt > 0 }}
			
			<h2>検索結果</h2>
			<form name="form1" action="order_shop_csv.php" method="post">
			<input type="hidden" name="shop_name" value="{{ $forms.shop_name }}" />
			<input type="hidden" name="size" value="{{ $forms.size }}" />
			<input type="hidden" name="page" value="{{ $page.current }}" />
			<table id="inquiry_result" class="formTable">
				<thead>
					<tr align="center">
						<th>商品コード</th>
						<th>ブランド名</th>
						<th>商品名</th>
						<th>サイズ</th>
						<th>参考価格</th>
						<th>原価</th>
						<th>更新日</th>
						<th>更新</th>
					</tr>

				</thead>
				<tbody>
					
{{ foreach from=$shoplist key=k item=v }}
					<tr>
						<td align="center">{{ $v.shop_id }}</td>
						<td>{{ $v.brand }}</td>
						<td>{{ $v.shop_name }}</td>
						<td>{{ $v.size }}</td>
						<td align="center">￥{{ $v.refer_price }}</td>
						<td align="center">￥{{ $v.cost_price }}</td>
						<td align="center">{{ $v.u_date }}</td>
						<td align="center"><a href='order_shop_form.php?shop_id={{ $v.shop_id }}&&mode=update'>[更新]</a></td>
					</tr>
{{ /foreach }}				
				</tbody>
			</table>

			<p align="center">
{{ if $page.current > 1 }}
				<a href="order_shop.php?page={{ $page.current-1 }}{{ $page.query }}">前の{{ $page.item }}件</a>&nbsp;&nbsp;
{{ /if }}
{{ foreach from=$page.paging key=k item=v }}
{{ if $v < $page.current+15 }}
{{ if $page.current == $v }}
{{ $v }}&nbsp;
{{ else }}
				<a href="order_shop.php?page={{ $v }}{{ $page.query }}">{{ $v }}</a>&nbsp;
{{ /if }}
{{ /if }}
{{ /foreach }}
{{ if $page.end > $page.current }}
				<a href="order_shop.php?page={{ $page.current+1 }}{{ $page.query }}">次の{{ $page.item }}件</a>
{{ /if }}
			</p>	
			
			<p class="button">
				<button type="submit" id="btn_csv" class="submit" ><span>CSV出力</span></button>
			</p>
		</form>
{{ /if }}
		</div></div>
			
			
		<address>Copyright (C) SHIFT Inc. / All rights reserved</address>

	</body>
</html>